﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Unis.ORM.Xml
{
    public class XmlSqlMappingInfo
    {
        // Fields
        private string _AddObject;
        private string _DeleteNotInIDS;
        private string _DeleteObject;
        private string _GetByForeingKey;
        private string _IniGetByLinkObjectKey;
        private string _KeyName;
        private string _ObjectName;
        private string _SelectObject;
        private string _UpdateObject;
        public const string SQL_ADD_OBJECT = "AddObject";
        public const string SQL_DELETE_NOT_IN_IDS = "DeleteNotInIDS";
        public const string SQL_DELETE_OBJECT = "DeleteObject";
        public const string SQL_GET_BY_FOREING_KEY = "GetByForeingKey";
        public const string SQL_INI_GET_BY_LINK_OBJECT = "IniGetByLinkObjectKey";
        public const string SQL_SELECT_BY_KEY = "SelectByKey";
        public const string SQL_SELECT_OBJECT = "SelectObject";
        public const string SQL_UPDATE_OBJECT = "UpdateObject";

        // Methods
        public XmlSqlMappingInfo()
            : this(null)
        {
        }

        public XmlSqlMappingInfo(string objectName)
        {
            this._SelectObject = "SelectObject";
            this._AddObject = "AddObject";
            this._DeleteObject = "DeleteObject";
            this._UpdateObject = "UpdateObject";
            this._GetByForeingKey = "GetByForeingKey";
            this._IniGetByLinkObjectKey = "IniGetByLinkObjectKey";
            this._KeyName = "ID";
            this._ObjectName = objectName;
        }

        public XmlSqlMappingInfo(string objectName, string selectName, string addName, string updateName, string deleteName, string keyName)
        {
            this._SelectObject = selectName;
            this._AddObject = addName;
            this._UpdateObject = updateName;
            this._DeleteObject = deleteName;
            this._KeyName = keyName;
            this._ObjectName = objectName;
        }

        // Properties
        public string AddObject
        {
            get
            {
                return this._AddObject;
            }
            set
            {
                this._AddObject = value;
            }
        }

        public string DeleteNotInIDS
        {
            get
            {
                return this._DeleteNotInIDS;
            }
            set
            {
                this._DeleteNotInIDS = value;
            }
        }

        public string DeleteObject
        {
            get
            {
                return this._DeleteObject;
            }
            set
            {
                this._DeleteObject = value;
            }
        }

        public string GetByForeingKey
        {
            get
            {
                return this._GetByForeingKey;
            }
            set
            {
                this._GetByForeingKey = value;
            }
        }

        public string IniGetByLinkObjectKey
        {
            get
            {
                return this._IniGetByLinkObjectKey;
            }
            set
            {
                this._IniGetByLinkObjectKey = value;
            }
        }

        public string KeyName
        {
            get
            {
                return this._KeyName;
            }
            set
            {
                this._KeyName = value;
            }
        }

        public string ObjectName
        {
            get
            {
                return this._ObjectName;
            }
            set
            {
                this._ObjectName = value;
            }
        }

        public string SelectObject
        {
            get
            {
                return this._SelectObject;
            }
            set
            {
                this._SelectObject = value;
            }
        }

        public string UpdateObject
        {
            get
            {
                return this._UpdateObject;
            }
            set
            {
                this._UpdateObject = value;
            }
        }
    }
}
